package com.tjbklx1.pattern2.chap34;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Client {
	public static void main(String[] args) throws Exception {
		Invoker invoker = new Invoker();
		while (true) {
			System.out.print("#");
			BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
			try {
				String input = in.readLine();
				if (input.equalsIgnoreCase("quit") || input.equalsIgnoreCase("exit")) {
					System.out.println("quit!!!");
					return;
				}
				System.out.println(invoker.exec(input));

			} catch (IOException ioe) {
				System.err.println("IO error trying to read your answer");
			}
		}
	}
}
